<template>
  <div class="app-container">
    <el-row :gutter="10">
      <fold :span="5" :xs="24" :show.sync='sideshow'>
        <el-card shadow="never">
          <org-tree ref="orgTree" modelType="'dept','community','floor','unit','room'" @nodeClick="handleNodeClick"
                    @firstNodeClick="handleNodeClick"/>
        </el-card>
      </fold>
      <el-col :span="sideshow ? 19 : 24" :xs="24">
        <el-card shadow="never">
          <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
              <el-button type="primary" plain size="mini" :class="{'btn-pitch-on':activeName=='fygl'?true:false}"  @click="handleJfgl">
                <svg-icon icon-class="FYGL" />
                费用管理
              </el-button>
            </el-col>
            <el-col :span="1.5">
              <el-button type="primary" plain size="mini" :class="{'btn-pitch-on':activeName=='sfbzsz'?true:false}" @click="handleSfbzsz">
                <svg-icon icon-class="shoufeibiaozhun" />
                收费标准设置
              </el-button>
            </el-col>
          </el-row>

          <div class="main">
            <fee-manage ref="feeRefs" :currentNode="currentNode" v-if="activeName=='fygl'"/>
            <room-norm ref="normRefs" :currentNode="currentNode" v-if="activeName=='sfbzsz'"/>
          </div>

        </el-card>

      </el-col>
    </el-row>

  </div>
</template>

<script>
  import FeeManage from "./feeManage"
  import RoomNorm from "./roomNorm"
  export default {
    name: "expenseManage",
    components:{ FeeManage,RoomNorm },
    data() {
      return {
        activeName: 'fygl',
        sideshow:true,
        currentNode: {}
      };
    },
    created() {
      this.activeName = this.$route.query.activeName||'fygl'
    },
    methods: {
      handleNodeClick(node) {
        this.currentNode = node
      },
      handleJfgl(){
        this.activeName = 'fygl'
      },
      handleSfbzsz(){
        this.activeName = 'sfbzsz'
      }
    }
  };
</script>

<style lang="scss" scoped >
  .btn-pitch-on{
    background-color: #1890ff;
    color: #FFFFFF;
  }
</style>
